<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" />
<?php include(DDROOTPATH.'/cache/title/'.$pagetag.'_title.php');?>
<LINK rel=stylesheet type=text/css href="template/<?=MOBAN?>/css/mall.css" />
<LINK rel=stylesheet type=text/css href="template/<?=MOBAN?>/css/common.css" />
<script type="text/javascript" src="template/<?=MOBAN?>/js/jquery-1.3.2.min.js"></script>
<SCRIPT type="text/javascript" src="template/<?=MOBAN?>/js/function.js"></SCRIPT>
<script language="javascript">
$.ajaxSetup ({
    cache: false //关闭AJAX相应的缓存
});

function imgAuto(img, maxW, maxH) {
	var oriImg = document.createElement("img");
	oriImg.onload = function(){
		if (oriImg.width == 0 || oriImg.height == 0)
			return;
		var oriW$H = oriImg.width / oriImg.height;
		// var maxW$H = maxW / maxH;

		if (oriImg.height > maxH) {
			img.height = maxH;
			// img.removeAttribute("width");
			img.width = maxH * oriW$H;
		}
		if (img.width > maxW) {
			img.width = maxW;
			// img.removeAttribute("height");
			img.height = maxW / oriW$H;
		}

		if (maxH) {// if it defined the maxH argument
			if (img.height > 0)
				img.style.marginTop = (maxH - img.height) / 2 + "px";
		}
	};
	oriImg.src = img.src;
}
    </script>
</head>

<body>
<?php
include("header.tpl.php");
?>
<?php
include("nav.tpl.php");
?>
<div id="weizhi">当前位置：<a href="index.php">首页</a> >优惠促销活动</div>
<div id="main">
	<div id="left">
		
		<div class="jsbar">
          <div class="current"><a>促销优惠</a></div>
        </div>
        
         <div class="dis sales_left" id="sh_tbc_04">
         <?php if($activity[0]['mallname']==''){?>
             <p style=" width:150px; text-align:center; margin:auto; margin-top:20px; color:#F00; font-size:16px"><b>暂无促销活动</b></p>
		 <?php }?>
								<?php foreach($activity as $row){?>
                                	<div class="sh_cx">
                                    	<div class="sh_cx_1">
                                        	<div class="sh_cx_1_p"><a target="_blank" href="cuxiao<?=$url_head_id?><?=$row['id']?><?=$url_end?>" title="<?=$row['name']?>"><img  onload="imgAuto(this,240,110);"  src="<?=$row['pic']?>" /></a></div>
                                            <div class="sh_cx_1_p_r">
 
                                           	  <div class="sh_cx_title"><a style="font-weight:bold; color:#03F" target="_blank" href="cuxiao<?=$url_head_id?><?=$row['id']?><?=$url_end?>" class="color_91"><?=$row['name']?></a></div>
                                                <div class="sh_cx_sj" style="margin-top:5px">所属商家：<a style="color:#F00; text-decoration:underline" href="mall<?=$url_head_id?><?=$row['mallid']?><?=$url_end?>"><?=$row['mallname']?></a></div>
                                                <div class="sh_cx_sj" style="margin-top:5px">活动时间：<?=$row['stime']?>至<?=$row['etime']?>（<?=sjc(date('Y-m-d'),$row['etime'])?>）</div>
                                                <div class="sh_cx_jj" style="margin-top:5px">活动简介：<?=$row['des']?></div>
                                                <div style="clear:both"></div>
                                          	</div>
 
                                            <div class="sh_cx_p_r_r">
                                            	<a href="cuxiao<?=$url_head_id?><?=$row['id']?><?=$url_end?>" target="_blank" class="b_cx_xq" style="font-size:12px; color:#333">查看详情</a>
                                            </div>
                                            <div style="clear:both"></div>
                                        </div>
                                  </div>
                                  <?php }?>
                                  <div class="megas512" style="text-align:center; margin:5px"><?php 
				pageft($total,$pagesize,1,0,0,10,$page_coupons);
				echo $pagenav;?>
		</div>
                              	</div>
                                <div style="height:10px">&nbsp;</div>

	</div>
	
	<div id="right">
		<div id="ad4"><?=AD(4)?></div>
	</div>
	<?php include("footer.tpl.php");?>
</div>
</body>
</html>
